#ifndef _TaskDesc_h_
#define _TaskDesc_h_

#include "Global.h"





class TaskDesc
	: public cocos2d::CCNode
	, public cocos2d::extension::CCBMemberVariableAssigner
	, public cocos2d::extension::CCBSelectorResolver
	, public cocos2d::extension::CCNodeLoaderListener
	, public ViewBase
{
public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TaskDesc, create);
	static TaskDesc* create(CCObject* pOwer);

	TaskDesc(void);
	~TaskDesc(void);

	virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::CCObject * pTarget, cocos2d::CCString * pSelectorName);
	virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::CCObject * pTarget, cocos2d::CCString * pSelectorName);
	virtual bool onAssignCCBMemberVariable(cocos2d::CCObject * pTarget, cocos2d::CCString * pMemberVariableName, cocos2d::CCNode * pNode);
	virtual void onNodeLoaded(cocos2d::CCNode * pNode, cocos2d::extension::CCNodeLoader * pNodeLoader);
	bool init();
	void refresh();
	void onEnter();
	void onExit();
private:
	CCLabelTTF* mName;
	CCLabelTTF* mDesc;
	CCLabelTTF* mExp;
	CCLabelTTF* mCoin;
	CCLabelTTF* mEnergy;
	ProgressText* mProgress;

	void onDoItBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
    
    void _onNotification(CCObject* object);
};

#endif